package com.kate.mall.bff.wx.feign;

import com.kate.mall.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author 新梦想.陈超
 * @version 2021.2
 * @Description: {TODO}
 * @date 2022/12/16 下午2:19
 */

@FeignClient(value = "product-center")
public interface ProductFeignClient {
    @GetMapping("/product/goods/list")
    R queryNewOrHotGoodsList(@RequestParam(required = false) Map<String, Object> params);
    @GetMapping("/product/goodsspecification/list")
    R goodsSpecificationsList(@RequestParam(required = false) Map<String, Object> params);

    @GetMapping("/product/goods/info/{id}")
    R getGoodsInfo(@PathVariable("id") Integer goodsId);

    @GetMapping("/product/goodsattribute/list")
    R findAtrributeRelateGoods(@RequestParam("goods_id") Integer id);

    @GetMapping("/product/comment/list")
    R getCommentRelateGoods(@RequestParam("goods_id")Integer id);

    @GetMapping("/product/brand/list")
    R goodsBrandRelateGoods(@RequestParam("goods_id") Integer id);

    @GetMapping("/product/goodsproduct/list")
    R productListRelatedGoods(@RequestParam("goods_id") Integer id);

    @GetMapping("/product/goods/info/{id}")
    R detail(@PathVariable("id") Integer id);


    @GetMapping("/product/goodsproduct/info/{productId}")
    R findProductById(@PathVariable("productId") Integer productId);

    @GetMapping("/product/brand/list")
    R queryBrandList(@RequestParam(required = false) Map<String, Object> params);

    @GetMapping(value = "/product/category/floor")
    R queryFloorGoodsList(@RequestParam("page") Integer page, @RequestParam("limit") Integer limit);

    @GetMapping(value = "/product/category/list")
    R queryCategoryList(@RequestParam Map<String, Object> param);

    @GetMapping("/product/goods/count")
    R homeGoodsCount();

    @GetMapping("/product/category/info/{id}")
    R queryCateById(@PathVariable("id") Integer categoryId);

    @GetMapping("/product/category/list")
    R queryChildCateByParentId(@RequestParam("parentId") Integer categoryId);

    @GetMapping(value = "/product/goods/list")
    R queryGoodsListBy2LCategoryId(@RequestParam Map<String, Object> param);
}
